<?php
/*****************************************************************************
 * Send email message based on get variables.
 *****************************************************************************/

include('load_wp_config.php');
// if (!wp_verify_nonce($_REQUEST['valid'],'em')) die();
$message_headers = 
    "From: \"{$_REQUEST['email_name']}\" <{$_REQUEST['email_from']}>\n" . 
    "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";

$result = wp_mail($_REQUEST['email_to'],$_REQUEST['email_subject'],$_REQUEST['email_message'],$message_headers);

?>

<script>
self.close();
</script>

<?php
if(get_option(SLPLUS_PREFIX.'-debugging') == 'on') {
    $fh = fopen('emaillog.txt', 'a') or die("can't open file");
    fwrite($fh, date("Y-m-d H:m:s")." ".$_REQUEST['email_subject']."\n");
    fclose($fh);
}
?>

